package com.qf.game;

/**
 * 引用类型转换
 */
public class Demo01 {
    public static void main(String[] args) {
        Weapon longSword = new LongSword();
        LongSword sword;
        sword = (LongSword) longSword;
        sword.setName("霜之哀伤");
        System.out.println(sword.getName());

        Axe axe;
        axe = (Axe) longSword;
        System.out.println(axe.getDamage());
    }
}
